/*
 * This file is a part of the SWFer project.
 *
 * Copyright (C) 2012 Michael Bradshaw <mjbshaw@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */

#ifndef DECODE_HPP
#define DECODE_HPP

#include "Packet.hpp"
#include "Tags.hpp"

namespace swfer
{

template <TagCode code>
bool decode(const Packet& packet, Tag<code>& tag);

template <>
extern bool decode<END>(const Packet& packet, Tag<END>& tag);
template <>
extern bool decode<SHOW_FRAME>(const Packet& packet, Tag<SHOW_FRAME>& tag);
template <>
extern bool decode<DEFINE_SHAPE>(const Packet& packet, Tag<DEFINE_SHAPE>& tag);
template <>
extern bool decode<PLACE_OBJECT>(const Packet& packet, Tag<PLACE_OBJECT>& tag);
template <>
extern bool decode<REMOVE_OBJECT>(const Packet& packet, Tag<REMOVE_OBJECT>& tag);
template <>
extern bool decode<DEFINE_BITS>(const Packet& packet, Tag<DEFINE_BITS>& tag);
template <>
extern bool decode<DEFINE_BUTTON>(const Packet& packet, Tag<DEFINE_BUTTON>& tag);
template <>
extern bool decode<JPEG_TABLES>(const Packet& packet, Tag<JPEG_TABLES>& tag);
template <>
extern bool decode<SET_BACKGROUND_COLOR>(const Packet& packet, Tag<SET_BACKGROUND_COLOR>& tag);
template <>
extern bool decode<DEFINE_FONT>(const Packet& packet, Tag<DEFINE_FONT>& tag);
template <>
extern bool decode<DEFINE_TEXT>(const Packet& packet, Tag<DEFINE_TEXT>& tag);
template <>
extern bool decode<DO_ACTION>(const Packet& packet, Tag<DO_ACTION>& tag);
template <>
extern bool decode<DEFINE_FONT_INFO>(const Packet& packet, Tag<DEFINE_FONT_INFO>& tag);
template <>
extern bool decode<DEFINE_SOUND>(const Packet& packet, Tag<DEFINE_SOUND>& tag);
template <>
extern bool decode<START_SOUND>(const Packet& packet, Tag<START_SOUND>& tag);
template <>
extern bool decode<DEFINE_BUTTON_SOUND>(const Packet& packet, Tag<DEFINE_BUTTON_SOUND>& tag);
template <>
extern bool decode<SOUND_STREAM_HEAD>(const Packet& packet, Tag<SOUND_STREAM_HEAD>& tag);
template <>
extern bool decode<SOUND_STREAM_BLOCK>(const Packet& packet, Tag<SOUND_STREAM_BLOCK>& tag);
template <>
extern bool decode<DEFINE_BITS_LOSSLESS>(const Packet& packet, Tag<DEFINE_BITS_LOSSLESS>& tag);
template <>
extern bool decode<DEFINE_BITS_JPEG2>(const Packet& packet, Tag<DEFINE_BITS_JPEG2>& tag);
template <>
extern bool decode<DEFINE_SHAPE2>(const Packet& packet, Tag<DEFINE_SHAPE2>& tag);
template <>
extern bool decode<DEFINE_BUTTON_CXFORM>(const Packet& packet, Tag<DEFINE_BUTTON_CXFORM>& tag);
template <>
extern bool decode<PROTECT>(const Packet& packet, Tag<PROTECT>& tag);
template <>
extern bool decode<PLACE_OBJECT2>(const Packet& packet, Tag<PLACE_OBJECT2>& tag);
template <>
extern bool decode<REMOVE_OBJECT2>(const Packet& packet, Tag<REMOVE_OBJECT2>& tag);
template <>
extern bool decode<DEFINE_SHAPE3>(const Packet& packet, Tag<DEFINE_SHAPE3>& tag);
template <>
extern bool decode<DEFINE_TEXT2>(const Packet& packet, Tag<DEFINE_TEXT2>& tag);
template <>
extern bool decode<DEFINE_BUTTON2>(const Packet& packet, Tag<DEFINE_BUTTON2>& tag);
template <>
extern bool decode<DEFINE_BITS_JPEG3>(const Packet& packet, Tag<DEFINE_BITS_JPEG3>& tag);
template <>
extern bool decode<DEFINE_BITS_LOSSLESS2>(const Packet& packet, Tag<DEFINE_BITS_LOSSLESS2>& tag);
template <>
extern bool decode<DEFINE_EDIT_TEXT>(const Packet& packet, Tag<DEFINE_EDIT_TEXT>& tag);
template <>
extern bool decode<DEFINE_SPRITE>(const Packet& packet, Tag<DEFINE_SPRITE>& tag);
template <>
extern bool decode<FRAME_LABEL>(const Packet& packet, Tag<FRAME_LABEL>& tag);
template <>
extern bool decode<SOUND_STREAM_HEAD2>(const Packet& packet, Tag<SOUND_STREAM_HEAD2>& tag);
template <>
extern bool decode<DEFINE_MORPH_SHAPE>(const Packet& packet, Tag<DEFINE_MORPH_SHAPE>& tag);
template <>
extern bool decode<DEFINE_FONT2>(const Packet& packet, Tag<DEFINE_FONT2>& tag);
template <>
extern bool decode<EXPORT_ASSETS>(const Packet& packet, Tag<EXPORT_ASSETS>& tag);
template <>
extern bool decode<IMPORT_ASSETS>(const Packet& packet, Tag<IMPORT_ASSETS>& tag);
template <>
extern bool decode<ENABLE_DEBUGGER>(const Packet& packet, Tag<ENABLE_DEBUGGER>& tag);
template <>
extern bool decode<DO_INIT_ACTION>(const Packet& packet, Tag<DO_INIT_ACTION>& tag);
template <>
extern bool decode<DEFINE_VIDEO_STREAM>(const Packet& packet, Tag<DEFINE_VIDEO_STREAM>& tag);
template <>
extern bool decode<VIDEO_FRAME>(const Packet& packet, Tag<VIDEO_FRAME>& tag);
template <>
extern bool decode<DEFINE_FONT_INFO2>(const Packet& packet, Tag<DEFINE_FONT_INFO2>& tag);
template <>
extern bool decode<ENABLE_DEBUGGER2>(const Packet& packet, Tag<ENABLE_DEBUGGER2>& tag);
template <>
extern bool decode<SCRIPT_LIMITS>(const Packet& packet, Tag<SCRIPT_LIMITS>& tag);
template <>
extern bool decode<SET_TAB_INDEX>(const Packet& packet, Tag<SET_TAB_INDEX>& tag);
template <>
extern bool decode<FILE_ATTRIBUTES>(const Packet& packet, Tag<FILE_ATTRIBUTES>& tag);
template <>
extern bool decode<PLACE_OBJECT3>(const Packet& packet, Tag<PLACE_OBJECT3>& tag);
template <>
extern bool decode<IMPORT_ASSETS2>(const Packet& packet, Tag<IMPORT_ASSETS2>& tag);
template <>
extern bool decode<DEFINE_FONT_ALIGN_ZONES>(const Packet& packet, Tag<DEFINE_FONT_ALIGN_ZONES>& tag);
template <>
extern bool decode<CSM_TEXT_SETTINGS>(const Packet& packet, Tag<CSM_TEXT_SETTINGS>& tag);
template <>
extern bool decode<DEFINE_FONT3>(const Packet& packet, Tag<DEFINE_FONT3>& tag);
template <>
extern bool decode<SYMBOL_CLASS>(const Packet& packet, Tag<SYMBOL_CLASS>& tag);
template <>
extern bool decode<METADATA>(const Packet& packet, Tag<METADATA>& tag);
template <>
extern bool decode<DEFINE_SCALING_GRID>(const Packet& packet, Tag<DEFINE_SCALING_GRID>& tag);
template <>
extern bool decode<DO_ABC>(const Packet& packet, Tag<DO_ABC>& tag);
template <>
extern bool decode<DEFINE_SHAPE4>(const Packet& packet, Tag<DEFINE_SHAPE4>& tag);
template <>
extern bool decode<DEFINE_MORPH_SHAPE2>(const Packet& packet, Tag<DEFINE_MORPH_SHAPE2>& tag);
template <>
extern bool decode<DEFINE_SCENE_AND_FRAME_LABEL_DATA>(const Packet& packet, Tag<DEFINE_SCENE_AND_FRAME_LABEL_DATA>& tag);
template <>
extern bool decode<DEFINE_BINARY_DATA>(const Packet& packet, Tag<DEFINE_BINARY_DATA>& tag);
template <>
extern bool decode<DEFINE_FONT_NAME>(const Packet& packet, Tag<DEFINE_FONT_NAME>& tag);
template <>
extern bool decode<START_SOUND2>(const Packet& packet, Tag<START_SOUND2>& tag);
template <>
extern bool decode<DEFINE_BITS_JPEG4>(const Packet& packet, Tag<DEFINE_BITS_JPEG4>& tag);
template <>
extern bool decode<DEFINE_FONT4>(const Packet& packet, Tag<DEFINE_FONT4>& tag);

}

#endif
